package com.atguigu.gmall.search.pojo;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.util.Date;
import java.util.List;

/**
 * @author liuxing
 * @create 2022-09-12 4:06
 */
@Data
@Document(indexName = "goods", type = "info", shards = 3, replicas = 2)
public class Goods {

    //商品列表
    @Id
    private Long skuId;
    @Field(type = FieldType.Text, index = false)
    private String defaultImag;
    @Field(type = FieldType.Double, index = false)
    private Double price;
    @Field(type = FieldType.Keyword)
    private String title;
    @Field(type = FieldType.Text, index = false)
    private String subTitle;

    //排序、分页
    @Field(type = FieldType.Long)
    private Long sale;
    @Field(type = FieldType.Date )
    private Date greatTime;
    @Field(type = FieldType.Boolean )
    private Boolean store;

    //品牌、分类
    @Field(type = FieldType.Long)
    private Long brandId;
    @Field(type = FieldType.Keyword)
    private String brandName;
    @Field(type = FieldType.Keyword)
    private String brandLogo;
    @Field(type = FieldType.Long)
    private Long categoryId;
    @Field(type = FieldType.Keyword)
    private String categoryName;
    @Field(type = FieldType.Nested)
    private List<SearchAttrValueVo> searchAttrs;

}
